<?php
namespace app\index\model;
use think\Model;
use app\index\model\Filex;

class Modelx extends Model
{
	protected $where=array("status"=>1);
	public function getChannel(){
		$data=Modelx::where($this->where)->select();
		$filex=new Filex();	
		
		$mess=array_map(function($v){
			return $v->toArray();
		}, $data);
		for ($i=0; $i < count($mess); $i++) { 
			if($mess[$i]['thumb']){
				$mess[$i]['annexes']=$filex->getThumbById($mess[$i]['thumb']);
			}
		}
		return $mess;
	}
	public function getMarkByid($id){
		$mark=Modelx::where('id',$id)->value('mark');
		// print_r($mark) ;
		return $mark;
	}
	public function getFieldById($id,$field){
		$data=Modelx::where('id',$id)->value($field);

		return $data;
	}
}